home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
001-025
/
scopedisk15
/
qrt
/
docs
/
cfg.doc
< prev
next >
Wrap
Text File
|
1995-03-18
|
8KB
|
265 lines
Context Free Grammar for QRT Input Language
Notes: '(' and ')' are non-terminal symbols
( and ) are CFG parens
+ is one or more than one
o lower case strings in grammar are non-terminals
o input language is not case sensitive
o <WHITE_SPACE> = blank | newline
o args can be separated by optional ',' or ';'
o '=' can separate argument name from value
or string.
<WORLD> = <INSTANCE_DEFS> ( <OBJECT> | <ATTRIBUTE> )+
<INSTANCE_DEFS> = begin_instances <OBJECT>+ end_instances
<OBJECT> = <PRIMITIVE>+ |
( name <STRING> | <EMPTY> )
begin_bbox <OBJECT> end_bbox
<PRIMITIVE> = <SPHERE> |
<PARALLELOGRAM> |
<RING> |
<QUADRATIC> |
<INSTANCE_OF>
<ATTRIBUTE> = <SKY> |
foc_length <NUMBER> |
first_scan <NUMBER> |
last_scan <NUMBER> |
<DEFAULT> |
file_name <STRING> |
<LAMP> |
<PATTERN> |
<OBSERVER>
<SPHERE> = sphere '(' <SPHERE_DEF>+ ')'
<SPHERE_DEF> = <POSITION> |
name <STRING> |
radius <NUM> |
<CINFO> |
pattern <STRING>
<PARALLELOGRAM> = parallelogram ( <PAR_DEF>+ )
QRT Ray Tracer Page 1 Context Free Grammar
<PAR_DEF> = <POSITION> |
name <STRING> |
v1 <VECTOR> |
vect1 <VECTOR> |
v2 <VECTOR> |
vect2 <VECTOR> |
<CINFO> |
pattern <STRING>
<TRIANGLE> = triangle ( <TRIANGLE_DEF>+ )
<TRIANGLE_DEF> = <POSITION> |
name <STRING> |
v1 <VECTOR> |
vect1 <VECTOR> |
v2 <VECTOR> |
vect2 <VECTOR> |
<CINFO> |
pattern <STRING>
<RING> = ring '(' <RING_REF>+ ')'
<RING_DEF> = <POSITION> |
name <STRING> |
v1 <VECTOR> |
vect1 <VECTOR> |
v2 <VECTOR> |
vect2 <VECTOR> |
rad_1 <NUM> |
rad_2 <NUM> |
<CINFO> |
pattern <STRING>
<QUADRATIC> = quadratic '(' <QUAD_DEF>+ ')'
<QUAD_DEF> = <POSITION> |
name <STRING> |
a <NUM> |
b <NUM> |
c <NUM> |
d <NUM> |
xmin <NUM> |
xmax <NUM> |
ymin <NUM> |
ymax <NUM> |
zmin <NUM> |
zmax <NUM> |
dir <VECTOR> |
<CINFO> |
pattern <STRING>
QRT Ray Tracer Page 2 Context Free Grammar
<INSTANCE_OF> = instance_of ( <INSTANCE>+ )
<INSTANCE> = name <STRING> |
<POSITION> |
scale = <VECTOR>
<SKY> = sky '(' <SKY_DEF>+ ')'
<SKY_DEF> = zenith <COLOR_TRIPLE> |
horiz <COLOR_TRIPLE>
<DEFAULT> = default '(' <DEFAULT_DEF>+ ')'
<DEFAULT_DEF> = <CINFO> |
no_shadow |
no_lamp
<LAMP> = lamp '(' <LAMP_DEF>+ ')'
<LAMP_DEF> = <POSITION> |
radius <NUM> |
dist <NUM> |
<AMB>+
<OBSERVER> = observer '(' <OBS_DEF>+ ')'
<OBS_DEF> = <POSITION> |
lookat <VECTOR> |
up <VECTOR>
<PATTERN> = pattern '(' <PATTERN_DEF>+ ')'
<PATTERN_DEF> = x_size <NUM> |
y_size <NUM> |
name <STRING> |
'(' <SUB_PATTERN>+ ')'
<SUB_PATTERN> = RECTANGLE <RECTANGLE_PAT> |
CIRCLE <CIRCLE_PAT>
<RECTANGLE_PAT> = start_x <NUM> |
stary_y <NUM> |
start_z <NUM> |
end_x <NUM> |
end_y <NUM> |
end_z <NUM> |
<CINFO>
<CIRCLE_PAT> = radius <NUM>
<CINFO>
QRT Ray Tracer Page 3 Context Free Grammar
<POSITION> = LOC <VECTOR> |
POS <VECTOR> |
LOCATION <VECTOR> |
POSITION <VECTOR>
<CINFO> = <AMB> |
<DIFF> |
<TRANS> |
<MIRROR> |
fuzz <INT> |
index <NUM> |
dither <INT> |
sreflect <NUM> |
reflect <NUM>
<AMB> = amb <COLOR_TRIPLE>
<DIFF> = diff <COLOR_TRIPLE>
<TRANS> = trans <COLOR_TRIPLE>
<MIRROR> = mirror <COLOR_TRIPLE>
<COLOR_TRIPLE> = '(' <NUM>, <NUM>, <NUM> ')'
<VECTOR> = '(' <NUM>, <NUM>, <NUM> ')'
<NUM> = <INT> |
- <INT> |
<INT> . <INT> |
- <INT> . <INT>
<INT> = <DIGIT>+
<DIGIT> = 0|1|2|3|4|5|6|7|8|9
<STRING> = ( <ALPHA> | <DIGIT> )+
<ALPHA> = a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|
q|r|s|t|u|v|w|x|y|z|_|*|-
<EMPTY> =
QRT Ray Tracer Page 4 Context Free Grammar